<div class="row m-b-10 dashboard-total-income">
    <div class="col-sm-12">
        <form class="form-inline" method="GET">
            <div class="form-group">
                <input
                        id="inline2mail"
                        type="text"
                        name="keywords"
                        class="form-control"
                        placeholder="名称检索"
                        value="{{ .req.Keywords }}"
                />
            </div>
            <div class="form-group">
                <button
                        type="submit"
                        class="btn btn-primary waves-effect waves-light m-r-10"
                >
                    检索
                </button>
            </div>
            <div class="form-group">
                <a
                        class="btn btn-success waves-effect waves-light"
                        href="/admin/articles/add"
                >添加</a
                >
            </div>
        </form>
    </div>
    <div class="col-sm-12 table-responsive m-t-10">
        <table class="table  table-bordered text-center">
            <thead>
            <tr>
                <th># ID</th>
                <th>名称</th>
                <th>封面</th>
                <th>栏目</th>
                <th>浏览</th>
                <th>喜欢</th>
                <th>评论</th>
                <th>来源</th>
                <th>状态</th>
                <th>时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody class="text-center">
            {{range $article := .list}}
                <tr>
                    <td>{{ $article.id }}</td>
                    <td>{{ $article.title }}</td>
                    <td>
                        <a href="{{ $article.cover }}" target="_blank">
                            <img src="{{ $article.cover }}" style="max-height: 40px;max-width: 30px;"
                                 class="img-thumbnail">
                        </a>
                    </td>
                    <td>{{ $article.category_name }}</td>
                    <td>{{ $article.view_num }}</td>
                    <td>{{ $article.like_num }}</td>
                    <td>{{ $article.comment_num }}</td>
                    <td>
                        {{if eq $article.from 0}}
                            <div class="tag tag-success">原创</div>
                        {{else if eq $article.from 1}}
                            <div class="tag tag-danger">转载</div>
                        {{else}}
                            <div class="tag tag-info">其他</div>
                        {{end}}
                    </td>
                    <td>
                        {{if eq $article.status 1}}
                            <div class="tag tag-success">发布</div>
                        {{else if eq $article.status 0}}
                            <div class="tag tag-danger">隐藏</div>
                        {{else}}
                            <div class="tag tag-warning">草稿</div>
                        {{end}}
                    </td>
                    <td>{{ $article.created_at }}</td>
                    <td>
                        <a class="btn btn-primary btn-sm" href="/admin/articles/{{ $article.id }}/edit">编辑</a
                        >
                        <a class="btn btn-success btn-sm" href="/articles/{{ $article.id }}" target="_blank">查看</a
                        >
                        <form
                                class="form form-inline form-destroy"
                                action="/admin/articles/{{ $article.id }}/delete"
                                method="POST"
                                style="display: inline;"
                        >
                            <button class="btn btn-danger btn-sm del-btn" type="button">删除</button>
                        </form>
                    </td>
                </tr>
            {{end}}
            </tbody>
        </table>
        <div class="page">
            {{ .page }}
        </div>
    </div>
</div>
